

#include <myClientProtocolInterface.h>
#include <myIOCPNetwork.h>
#include <sstream>
using namespace std;
using namespace myFn;
using namespace myFn::myIOCPNetwork;


namespace stest
{
	class myRecvTestProtocol:public myProtocolInterface
	{
	public:
		long _onRecv(char *data,long dataLen,myClientInterface *pClient=0);
		myRecvTestProtocol()
		{
			set_empty();
			iBuffSize=1024;
		}
		void set_empty()
		{
			str="";
			lastChar = '-';
			isum=0;
			iCount = 0;
			ierr=0;
			irecvCount=0;
		}

		stdstring str;
		char lastChar;
		int iCount;
		int isum;
		int ierr;
		int iBuffSize;
		int irecvCount;
	};



	extern myTcpServer *tcps;
	extern myRecvTestProtocol tprol;


	long iocpInit();
	long iocpStartServer(int port);
	long iocpGerResult(CString &result);
	long iocpClearResult(CString &str);
		
};

using namespace stest;








